/*
 * @Description: 
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2021-08-26 20:04:28
 * @LastEditors: gaoluo
 * @LastEditTime: 2021-12-04 11:46:28
 * @FilePath: /nhw/vue.config.js
 */

const pxtorem = require('postcss-pxtorem');

module.exports = {
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          pxtorem({
            rootValue({ file }) {
              return file.indexOf('vant') !== -1 ? 37.5 : 75;
            },
            propList: ["*"],
          }),
        ],
      },
    },
    extract: process.env.NODE_ENV === 'production' ? {
      ignoreOrder: true
    } : false
  },
  configureWebpack: {
    resolve: {
      alias: {
        assets: '@/assets',
        views: '@/views',
        style: '@/style',
        components: '@/components'
      }
    },
    // externals: {
    //   'BaiduMap': 'BMap',
    // },
  },
  devServer: {
    proxy: {
      '/nhw/': {
        target: process.env.VUE_APP_SERVERBASE,
      }
    }
  },
  publicPath: process.env.NODE_ENV === 'production'
    ? '/nhw/dist/'
    : '/',
  lintOnSave: false,
  productionSourceMap: false,
};